package com.uobgroup.ews.uam.core.service;

import java.util.List;

import com.uobgroup.ews.uam.core.domain.Reference;
import com.uobgroup.ews.uam.core.domain.ReferenceType;
import com.uobgroup.ews.uam.core.domain.Segment;

public interface ReferenceService {

   public abstract long countAllReferences();

   public abstract void deleteReference(Reference reference);

   public abstract Reference findReference(Long id);

   public abstract List<Reference> findAllReferences();

   public abstract List<Reference> findReferenceEntries(int firstResult, int maxResults);

   public abstract void saveReference(Reference reference);

   public abstract Reference updateReference(Reference reference);

   public abstract List<Reference> findAllProcessingCenters();

   public abstract List<Reference> findAllDepartments();

   public abstract List<Reference> findAllCountrys();

   public abstract List<Reference> findAllDocumentTypes();

   public abstract List<Reference> findAllProductTypes();
   
   public abstract List<Reference> findAllTransactionTypes();
   
   public abstract List<Reference> findAllUserLocations();
   
   public abstract List<Reference> findAllRoleType();
   
   public abstract void saveSegment(Segment segment);

   public abstract Segment findSegment(Long id);

   public abstract List<Segment> findSegmentEntries(int firstResult, int sizeNo);

   public abstract float countSegments();

   public abstract List<Segment> findAllSegments();

   public abstract void updateSegment(Segment segment);

   public abstract void remove(Segment segment);

   public List<Reference> findAllReferencesThatHasNoSegment();
   
   public List<Reference> findSegmentReferenceByName(String name);
   
   public Reference findFirstReferenceRoleType();
   
   /*
    * DongN
    */
   public Reference findReferencesByType(ReferenceType referenceType);
   
   public List<ReferenceType> findReferenceTypesThatHasReferencesByApplicationScope();
   
   public List<ReferenceType> findReferenceTypesThatHasReferencesBySecurityScope();
   
   public long countReferencesByType(ReferenceType referenceType);
   
   public List<Reference> findReferencesByType(ReferenceType referenceType, int firstResult, int maxResults);
   
   public List<Reference> findReferencesThatHasSecurityScope(int firstResult, int maxResults);
   
   public List<Reference> findReferencesThatHasApplicationScope(int firstResult, int maxResults);
   
   public long countReferencesBySecurityScope();
   
   public long countReferencesByApplicationScope();
   
   public Reference findReferenceByName(String name);
   
   public Reference findReferenceByCode(String code);
   
   public Reference findReferenceByIdAndSecurityScope(Long id);
   
   public Reference findReferenceByIdAndApplicationScope(Long id);
   
   public Reference findReferenceThatHasNameAndNotHasId(String name, Long id);
   
   public Reference findReferenceThatHasCodeAndNotHasId(String code, Long id);
   
   public long countSegmentsThatHasSegmentReference(Reference segment);
   /*
    * DongN
    */
   
}
